package com.lzy.cloud.sms.service.impl;

import com.github.pagehelper.PageHelper;
import com.lzy.cloud.sms.dtos.SmsTemplateDto;
import com.lzy.cloud.sms.mapper.SmsTemplateMapperExt;
import com.lzy.cloud.sms.service.SmsTemplateService;
import com.lzy.framework.core.orm.db.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SmsTemplateServiceImpl implements SmsTemplateService {

    @Autowired
    private SmsTemplateMapperExt smsTemplateMapperExt;

    @Override
    public Long insert(SmsTemplateDto smsTemplateDto) {
        return null;
    }

    @Override
    public int update(SmsTemplateDto smsTemplateDto) {
        return 0;
    }

    @Override
    public Boolean delete(Long aLong) {
        return null;
    }

    @Override
    public Boolean remove(Long aLong) {
        return null;
    }

    @Override
    public SmsTemplateDto findById(Long aLong) {
        return null;
    }

    @Override
    public List<SmsTemplateDto> query(Pager pager, SmsTemplateDto smsTemplateDto) {
        if (pager != null) {
            PageHelper.startPage(pager.getPageNum(), pager.getPageSize());
        }
        return smsTemplateMapperExt.query(smsTemplateDto);
    }

    @Override
    public SmsTemplateDto queryByType(Integer type) {
        SmsTemplateDto smsTemplateDto = new SmsTemplateDto();
        smsTemplateDto.setBusiType(type);
        return smsTemplateMapperExt.query(smsTemplateDto).get(0);
    }
}
